package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.MarketCategory;
import com.cskaoyan.bean.MarketGoods;
import com.cskaoyan.bean.param.CommonData;
import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.util.List;

/**
 * @author Can
 * @since 2022/06/29 23:09
 */
@Data
public class WXGoodsListVO {
    Integer limit;
    Integer page;
    Integer pages;
    Integer total;
    List<MarketGoods> list;
    List<MarketCategory> filterCategoryList;

    public static WXGoodsListVO data(PageInfo pageInfo) {
        WXGoodsListVO data = new WXGoodsListVO();
        data.setTotal((int) pageInfo.getTotal());
        data.setPages(pageInfo.getPages());
        data.setPage(pageInfo.getPageNum());
        data.setLimit(pageInfo.getPageSize());
        data.setList(pageInfo.getList());
        return data;
    }
}
